package cn.fisok.pdman.command.impl;

import cn.fisok.pdman.command.Command;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public abstract class AbstractDBCommand<T> implements Command<T> {
    public static final String KEY_DRIVER_CLASS_NAME = "driver_class_name";
    public static final String KEY_URL = "url";
    public static final String KEY_USERNAME = "username";
    public static final String KEY_PASSWORD = "password";

    protected Logger logger = LoggerFactory.getLogger(getClass());

    protected String driverClassName;
    protected String url;
    protected String username;
    protected String password;

    public void init(Map<String,String> params){
        driverClassName = params.get(KEY_DRIVER_CLASS_NAME);
        url = params.get(KEY_URL);
        username = params.get(KEY_USERNAME);
        password = params.get(KEY_PASSWORD);
    }
}
